package cac.fenjian.resource.msCommission.rest;

import cac.fenjian.resource.msCommission.service.MsCommissionService;
import com.cac.dme.adapter.rest.msg.ResponseMsg;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * @className: MsCommissionRest
 * @description: （描述这个类的作用）
 * @author: lqc
 * @date: 2023/9/20 10:48:48 周三
 * @version: 1.0
 */
@RestController
@RequestMapping("/Commission")
@Slf4j
public class MsCommissionRest {

    @Autowired
    private MsCommissionService msCommissionService;

    @GetMapping("/createC")
    public void createCommission(){
        String type ="notDelivery";
        String groupCode ="4028536c8a8d86c4018a8d8846180003";
        msCommissionService.createCommission(type,groupCode);
        log.info("over");
    }

    //查询待办
    @PostMapping("/queryCommissionC")
    public PageInfo queryCommissionC(@RequestBody HashMap param) {
        HashMap queryParam = (HashMap) param.get("queryParam");
        HashMap page = (HashMap) param.get("page");
        int startPage = Integer.parseInt(page.get("currentPage").toString());
        int pageSize = Integer.parseInt(page.get("pageSize").toString());
        return msCommissionService.queryCommissionC(startPage, pageSize, queryParam);
    }
}
